/**
 * 
 */
package parser;

import java.io.File;
import java.io.IOException;

/**
 * Creates a StringMatchSet with the locations
 * of a string in a file
 */
public class StringFinder {
	private String regex, filePath;
	
	public StringFinder(String regex, String filePath) {
		this.regex = regex;
		this.filePath = filePath;
	}
	
	public StringMatchSet findStrings() {
		// Find all matching strings in the file
		File f = null;
		//try
		//{
			f = Utility.createInputSpecificationFile(regex);
		//}catch (IOException e){System.out.println(e);}
			String[] args = {"./tempinputspecification.txt",filePath};
		return scanner.RegexProject.getTokens(args);
		
	}

	public String getRegex() {
		return regex;
	}

	public void setRegex(String regex) {
		this.regex = regex;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
}
